package com.qiche.controller.mgr;

import com.qiche.aspect.Result;
import com.qiche.model.Region;
import com.qiche.service.RegionService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

/**
 * 区域管理控制器
 * Created by Linzw on 2018/01/24.
 */
@Api(value = "/regions",description = "区域管理控制器")
@RestController
@RequestMapping("/regions")
public class RegionController {
	@Resource
	private RegionService regionService;

	@ApiOperation(value ="获取所有区域列表" )
	@GetMapping(value = "/getAll")
	public Result getAll() {
		List<Region> regionList = regionService.selectAll();
		return Result.createBySuccess(regionList);
	}
}
